<?php
	include_once('connectvars.php');
	include_once('constants.php');


	class DBConnection {

		private $mysqli;
		public function getDBC() {
			if(isset($mysqli)){
				return $mysqli;
			}
			$mysqli = new mysqli(DB_HOST, DB_USER, DB_PW, DB_NAME);
			if(!$mysqli){
				die('The server returned the following error while trying connect: ' . $mysqli->connect_error);

			}else{
				return $mysqli;
			}
		}

	}
?>